package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.user.UserOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/order")
@Api(tags = "C端-订单预计送达时间")
@Slf4j
public class UserOrderController {

    @Autowired
    private UserOrderService userOrderService;

    @GetMapping("/getEstimatedDeliveryTime")
    @ApiOperation("获取预计送达时间")
    public Result<String> getDeliveryTime(Integer shopId, String customerAddress){
        log.info("接受获取预计送达时间的参数{},{}",shopId,customerAddress);
         customerAddress = customerAddress.replace("\n","");
        return userOrderService.getDeliveryTime(shopId, customerAddress);
    }
}
